<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<h3>${action}</h3>
<p class="delete-success" ></p>
<c:choose>
	<c:when test="${empty entities}">
	<p class="comment-title">No comments yet, feel proud to be the first guy to commit comment!?</p>
	</c:when>
	<c:otherwise>
		<c:if test="${isBlogPage}">
			<p class="comment-title">${fn:length(entities)} Generous Comments </p>
		</c:if>
	</c:otherwise>
</c:choose>
<c:forEach var="comment" items="${entities}">
	<article id="show-comment">
		<div id="comment-info">
			<c:choose>
				<c:when test="${not empty comment.url}"><a href="${comment.url}">${comment.username}</a></c:when>
				<c:otherwise>${comment.username}</c:otherwise>
			</c:choose>
			<span>${comment.modifiedDate}</span>
		</div>
		<div id="comment-content">
			<p>
			${comment.content}
			<c:if test="${isAdmin}">
				<a class="delete" alt="delete comment" href="javascript:deleteComment(${comment.post.id}, ${comment.id})"><img src="images/delete.png"  title="delete comment" /></a>
			</c:if>
			</p>
		</div>
	</article>
</c:forEach>
